package org.example.design.command.test1;

import lombok.Data;

/**
 * @author huangshen
 * @version 0
 * @description 存货
 * @since 2022/2/14 11:26
 */
@Data
public class Stock {

    private String name;

    private int quantity;

    public Stock(String name, int quantity) {
        this.name = name;
        this.quantity = quantity;
    }

    public void buy(){
        System.out.println("Name: "+name+",bought Quantity: " + quantity);
    }

    public void sell(){
        System.out.println("Name: "+name+",sold Quantity: " + quantity);
    }

}
